{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8cbc8b1b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "airDF = pd.read_csv('data/airData/aqi_data_u.csv')\n",
    "cityDF = pd.read_csv('data/airData/city.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e7ca3758",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>cityname</th>\n",
       "      <th>aqi</th>\n",
       "      <th>pm2_5</th>\n",
       "      <th>pm10</th>\n",
       "      <th>so2</th>\n",
       "      <th>no2</th>\n",
       "      <th>co</th>\n",
       "      <th>o3</th>\n",
       "      <th>primary_pollutant</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2014-12-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>53</td>\n",
       "      <td>33</td>\n",
       "      <td>55</td>\n",
       "      <td>3</td>\n",
       "      <td>23</td>\n",
       "      <td>1.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>PM10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2015-01-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31</td>\n",
       "      <td>18</td>\n",
       "      <td>29</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "      <td>0.5</td>\n",
       "      <td>45.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2015-01-30</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>34</td>\n",
       "      <td>19</td>\n",
       "      <td>30</td>\n",
       "      <td>7</td>\n",
       "      <td>13</td>\n",
       "      <td>0.6</td>\n",
       "      <td>48.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2015-01-29</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31</td>\n",
       "      <td>18</td>\n",
       "      <td>31</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>0.5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2015-01-28</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>29</td>\n",
       "      <td>18</td>\n",
       "      <td>29</td>\n",
       "      <td>7</td>\n",
       "      <td>14</td>\n",
       "      <td>0.6</td>\n",
       "      <td>27.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         time cityname  aqi  pm2_5  pm10  so2  no2   co    o3  \\\n",
       "0  2014-12-31      阿坝州   53     33    55    3   23  1.0  35.0   \n",
       "1  2015-01-31      阿坝州   31     18    29    7   10  0.5  45.0   \n",
       "2  2015-01-30      阿坝州   34     19    30    7   13  0.6  48.0   \n",
       "3  2015-01-29      阿坝州   31     18    31    7   15  0.5  32.0   \n",
       "4  2015-01-28      阿坝州   29     18    29    7   14  0.6  27.0   \n",
       "\n",
       "  primary_pollutant  \n",
       "0              PM10  \n",
       "1               NaN  \n",
       "2               NaN  \n",
       "3               NaN  \n",
       "4               NaN  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "0cfd9c96",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>city</th>\n",
       "      <th>lat</th>\n",
       "      <th>lng</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>安康</td>\n",
       "      <td>32.704370</td>\n",
       "      <td>109.038045</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>阿克苏地区</td>\n",
       "      <td>41.171731</td>\n",
       "      <td>80.269846</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>阿里地区</td>\n",
       "      <td>30.404557</td>\n",
       "      <td>81.107669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>阿拉善盟</td>\n",
       "      <td>38.843075</td>\n",
       "      <td>105.695683</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    city        lat         lng\n",
       "0    阿坝州  31.905763  102.228565\n",
       "1     安康  32.704370  109.038045\n",
       "2  阿克苏地区  41.171731   80.269846\n",
       "3   阿里地区  30.404557   81.107669\n",
       "4   阿拉善盟  38.843075  105.695683"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cityDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ada58b18",
   "metadata": {},
   "outputs": [],
   "source": [
    "airDF = airDF.rename(columns={'cityname':'city'})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "91e6746d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>city</th>\n",
       "      <th>aqi</th>\n",
       "      <th>pm2_5</th>\n",
       "      <th>pm10</th>\n",
       "      <th>so2</th>\n",
       "      <th>no2</th>\n",
       "      <th>co</th>\n",
       "      <th>o3</th>\n",
       "      <th>primary_pollutant</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2014-12-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>53</td>\n",
       "      <td>33</td>\n",
       "      <td>55</td>\n",
       "      <td>3</td>\n",
       "      <td>23</td>\n",
       "      <td>1.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>PM10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2015-01-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31</td>\n",
       "      <td>18</td>\n",
       "      <td>29</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "      <td>0.5</td>\n",
       "      <td>45.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2015-01-30</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>34</td>\n",
       "      <td>19</td>\n",
       "      <td>30</td>\n",
       "      <td>7</td>\n",
       "      <td>13</td>\n",
       "      <td>0.6</td>\n",
       "      <td>48.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2015-01-29</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31</td>\n",
       "      <td>18</td>\n",
       "      <td>31</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>0.5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2015-01-28</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>29</td>\n",
       "      <td>18</td>\n",
       "      <td>29</td>\n",
       "      <td>7</td>\n",
       "      <td>14</td>\n",
       "      <td>0.6</td>\n",
       "      <td>27.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         time city  aqi  pm2_5  pm10  so2  no2   co    o3 primary_pollutant\n",
       "0  2014-12-31  阿坝州   53     33    55    3   23  1.0  35.0              PM10\n",
       "1  2015-01-31  阿坝州   31     18    29    7   10  0.5  45.0               NaN\n",
       "2  2015-01-30  阿坝州   34     19    30    7   13  0.6  48.0               NaN\n",
       "3  2015-01-29  阿坝州   31     18    31    7   15  0.5  32.0               NaN\n",
       "4  2015-01-28  阿坝州   29     18    29    7   14  0.6  27.0               NaN"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "663cd81e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>city</th>\n",
       "      <th>aqi</th>\n",
       "      <th>pm2_5</th>\n",
       "      <th>pm10</th>\n",
       "      <th>so2</th>\n",
       "      <th>no2</th>\n",
       "      <th>co</th>\n",
       "      <th>o3</th>\n",
       "      <th>primary_pollutant</th>\n",
       "      <th>lat</th>\n",
       "      <th>lng</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2014-12-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>53</td>\n",
       "      <td>33</td>\n",
       "      <td>55</td>\n",
       "      <td>3</td>\n",
       "      <td>23</td>\n",
       "      <td>1.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>PM10</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2015-01-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31</td>\n",
       "      <td>18</td>\n",
       "      <td>29</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "      <td>0.5</td>\n",
       "      <td>45.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2015-01-30</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>34</td>\n",
       "      <td>19</td>\n",
       "      <td>30</td>\n",
       "      <td>7</td>\n",
       "      <td>13</td>\n",
       "      <td>0.6</td>\n",
       "      <td>48.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2015-01-29</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31</td>\n",
       "      <td>18</td>\n",
       "      <td>31</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>0.5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2015-01-28</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>29</td>\n",
       "      <td>18</td>\n",
       "      <td>29</td>\n",
       "      <td>7</td>\n",
       "      <td>14</td>\n",
       "      <td>0.6</td>\n",
       "      <td>27.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         time city  aqi  pm2_5  pm10  so2  no2   co    o3 primary_pollutant  \\\n",
       "0  2014-12-31  阿坝州   53     33    55    3   23  1.0  35.0              PM10   \n",
       "1  2015-01-31  阿坝州   31     18    29    7   10  0.5  45.0               NaN   \n",
       "2  2015-01-30  阿坝州   34     19    30    7   13  0.6  48.0               NaN   \n",
       "3  2015-01-29  阿坝州   31     18    31    7   15  0.5  32.0               NaN   \n",
       "4  2015-01-28  阿坝州   29     18    29    7   14  0.6  27.0               NaN   \n",
       "\n",
       "         lat         lng  \n",
       "0  31.905763  102.228565  \n",
       "1  31.905763  102.228565  \n",
       "2  31.905763  102.228565  \n",
       "3  31.905763  102.228565  \n",
       "4  31.905763  102.228565  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airCityDF = pd.merge(airDF,cityDF,on='city',how='inner')\n",
    "airCityDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "5f31c66f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1887"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airCityDF.time.value_counts().count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "2229bbb5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "345908"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 查看03这列数据是否有空值\n",
    "airCityDF['o3'].isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "db727a0a",
   "metadata": {},
   "outputs": [],
   "source": [
    "for city in airCityDF.city.value_counts().index:\n",
    "    '''\n",
    "    for循环计算每个城市污染物的平均值后替换NaN值\n",
    "    '''\n",
    "    airCityDF.loc[(airCityDF['city'] == city) &(airCityDF['o3'].isnull()),'o3'] = airCityDF[airCityDF['city'] == city]['o3'].mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "6b5b4e7e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airCityDF['o3'].isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "9103e429",
   "metadata": {},
   "outputs": [],
   "source": [
    "airCityDF.drop(['primary_pollutant'],axis=1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "a316a178",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>city</th>\n",
       "      <th>aqi</th>\n",
       "      <th>pm2_5</th>\n",
       "      <th>pm10</th>\n",
       "      <th>so2</th>\n",
       "      <th>no2</th>\n",
       "      <th>co</th>\n",
       "      <th>o3</th>\n",
       "      <th>lat</th>\n",
       "      <th>lng</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2014-12-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>53</td>\n",
       "      <td>33</td>\n",
       "      <td>55</td>\n",
       "      <td>3</td>\n",
       "      <td>23</td>\n",
       "      <td>1.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2015-01-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31</td>\n",
       "      <td>18</td>\n",
       "      <td>29</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "      <td>0.5</td>\n",
       "      <td>45.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2015-01-30</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>34</td>\n",
       "      <td>19</td>\n",
       "      <td>30</td>\n",
       "      <td>7</td>\n",
       "      <td>13</td>\n",
       "      <td>0.6</td>\n",
       "      <td>48.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2015-01-29</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31</td>\n",
       "      <td>18</td>\n",
       "      <td>31</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>0.5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2015-01-28</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>29</td>\n",
       "      <td>18</td>\n",
       "      <td>29</td>\n",
       "      <td>7</td>\n",
       "      <td>14</td>\n",
       "      <td>0.6</td>\n",
       "      <td>27.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         time city  aqi  pm2_5  pm10  so2  no2   co    o3        lat  \\\n",
       "0  2014-12-31  阿坝州   53     33    55    3   23  1.0  35.0  31.905763   \n",
       "1  2015-01-31  阿坝州   31     18    29    7   10  0.5  45.0  31.905763   \n",
       "2  2015-01-30  阿坝州   34     19    30    7   13  0.6  48.0  31.905763   \n",
       "3  2015-01-29  阿坝州   31     18    31    7   15  0.5  32.0  31.905763   \n",
       "4  2015-01-28  阿坝州   29     18    29    7   14  0.6  27.0  31.905763   \n",
       "\n",
       "          lng  \n",
       "0  102.228565  \n",
       "1  102.228565  \n",
       "2  102.228565  \n",
       "3  102.228565  \n",
       "4  102.228565  "
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airCityDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "98c0c5c8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time     False\n",
       "city     False\n",
       "aqi      False\n",
       "pm2_5    False\n",
       "pm10     False\n",
       "so2      False\n",
       "no2      False\n",
       "co       False\n",
       "o3       False\n",
       "lat      False\n",
       "lng      False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airCityDF.isnull().any()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "af21d586",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time        0\n",
       "city        0\n",
       "aqi      4199\n",
       "pm2_5    6817\n",
       "pm10     4817\n",
       "so2      1631\n",
       "no2      1621\n",
       "co       3493\n",
       "o3       2342\n",
       "lat         0\n",
       "lng         0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 导⼊numpy模块\n",
    "import numpy as np\n",
    "# ⽤NaN替代0，⽅便填充数据\n",
    "airCityDF[['aqi', 'pm2_5', 'pm10', 'so2', 'no2', 'co', 'o3']] = airCityDF[['aqi', 'pm2_5', 'pm10', 'so2','no2', 'co', 'o3']].replace(0,np.NaN)\n",
    "# 将0值替换后缺失值的数量\n",
    "airCityDF.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "0b5807ab",
   "metadata": {},
   "outputs": [],
   "source": [
    "for city in airCityDF.city.value_counts().index:\n",
    "    '''\n",
    "    for循环计算每个城市污染物的平均值后替换NaN值\n",
    "    '''\n",
    "    for pollutant in ['aqi', 'pm2_5', 'pm10', 'so2', 'no2', 'co', 'o3']:\n",
    "        airCityDF.loc[(airCityDF['city'] == city) &(airCityDF[pollutant].isnull()), pollutant] = airCityDF[airCityDF['city']== city][pollutant].mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "0ca1838d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time     0\n",
       "city     0\n",
       "aqi      0\n",
       "pm2_5    0\n",
       "pm10     0\n",
       "so2      0\n",
       "no2      0\n",
       "co       0\n",
       "o3       0\n",
       "lat      0\n",
       "lng      0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airCityDF.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "f17223c4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 根据⽉份创建季节列\n",
    "seasons = {12: 'Winter',\n",
    " 1: 'Winter',\n",
    " 2: 'Winter',\n",
    " 3: 'Spring',\n",
    " 4: 'Spring',\n",
    " 5: 'Spring',\n",
    " 6: 'Summer',\n",
    " 7: 'Summer',\n",
    " 8: 'Summer',\n",
    " 9: 'Autumn',\n",
    " 10: 'Autumn',\n",
    " 11: 'Autumn'\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "fa5a23b8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 557424 entries, 0 to 557423\n",
      "Data columns (total 11 columns):\n",
      " #   Column  Non-Null Count   Dtype  \n",
      "---  ------  --------------   -----  \n",
      " 0   time    557424 non-null  object \n",
      " 1   city    557424 non-null  object \n",
      " 2   aqi     557424 non-null  float64\n",
      " 3   pm2_5   557424 non-null  float64\n",
      " 4   pm10    557424 non-null  float64\n",
      " 5   so2     557424 non-null  float64\n",
      " 6   no2     557424 non-null  float64\n",
      " 7   co      557424 non-null  float64\n",
      " 8   o3      557424 non-null  float64\n",
      " 9   lat     557424 non-null  float64\n",
      " 10  lng     557424 non-null  float64\n",
      "dtypes: float64(9), object(2)\n",
      "memory usage: 51.0+ MB\n"
     ]
    }
   ],
   "source": [
    "airCityDF.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "fa953955",
   "metadata": {},
   "outputs": [],
   "source": [
    "airCityDF['time'] = pd.to_datetime(airCityDF['time'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "417d6ee1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 557424 entries, 0 to 557423\n",
      "Data columns (total 11 columns):\n",
      " #   Column  Non-Null Count   Dtype         \n",
      "---  ------  --------------   -----         \n",
      " 0   time    557424 non-null  datetime64[ns]\n",
      " 1   city    557424 non-null  object        \n",
      " 2   aqi     557424 non-null  float64       \n",
      " 3   pm2_5   557424 non-null  float64       \n",
      " 4   pm10    557424 non-null  float64       \n",
      " 5   so2     557424 non-null  float64       \n",
      " 6   no2     557424 non-null  float64       \n",
      " 7   co      557424 non-null  float64       \n",
      " 8   o3      557424 non-null  float64       \n",
      " 9   lat     557424 non-null  float64       \n",
      " 10  lng     557424 non-null  float64       \n",
      "dtypes: datetime64[ns](1), float64(9), object(1)\n",
      "memory usage: 51.0+ MB\n"
     ]
    }
   ],
   "source": [
    "airCityDF.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "e3d441c0",
   "metadata": {},
   "outputs": [],
   "source": [
    "airCityDF['season'] = airCityDF['time'].apply(lambda x:seasons[x.month])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "438e717f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>city</th>\n",
       "      <th>aqi</th>\n",
       "      <th>pm2_5</th>\n",
       "      <th>pm10</th>\n",
       "      <th>so2</th>\n",
       "      <th>no2</th>\n",
       "      <th>co</th>\n",
       "      <th>o3</th>\n",
       "      <th>lat</th>\n",
       "      <th>lng</th>\n",
       "      <th>season</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2014-12-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>53.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>55.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2015-01-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>45.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2015-01-30</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>34.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>48.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2015-01-29</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2015-01-28</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>29.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>27.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        time city   aqi  pm2_5  pm10  so2   no2   co    o3        lat  \\\n",
       "0 2014-12-31  阿坝州  53.0   33.0  55.0  3.0  23.0  1.0  35.0  31.905763   \n",
       "1 2015-01-31  阿坝州  31.0   18.0  29.0  7.0  10.0  0.5  45.0  31.905763   \n",
       "2 2015-01-30  阿坝州  34.0   19.0  30.0  7.0  13.0  0.6  48.0  31.905763   \n",
       "3 2015-01-29  阿坝州  31.0   18.0  31.0  7.0  15.0  0.5  32.0  31.905763   \n",
       "4 2015-01-28  阿坝州  29.0   18.0  29.0  7.0  14.0  0.6  27.0  31.905763   \n",
       "\n",
       "          lng  season  \n",
       "0  102.228565  Winter  \n",
       "1  102.228565  Winter  \n",
       "2  102.228565  Winter  \n",
       "3  102.228565  Winter  \n",
       "4  102.228565  Winter  "
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airCityDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "830898c9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>city</th>\n",
       "      <th>aqi</th>\n",
       "      <th>pm2_5</th>\n",
       "      <th>pm10</th>\n",
       "      <th>so2</th>\n",
       "      <th>no2</th>\n",
       "      <th>co</th>\n",
       "      <th>o3</th>\n",
       "      <th>lat</th>\n",
       "      <th>lng</th>\n",
       "      <th>season</th>\n",
       "      <th>quality</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2014-12-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>53.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>55.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>良好</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2015-01-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>45.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2015-01-30</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>34.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>48.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2015-01-29</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2015-01-28</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>29.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>27.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        time city   aqi  pm2_5  pm10  so2   no2   co    o3        lat  \\\n",
       "0 2014-12-31  阿坝州  53.0   33.0  55.0  3.0  23.0  1.0  35.0  31.905763   \n",
       "1 2015-01-31  阿坝州  31.0   18.0  29.0  7.0  10.0  0.5  45.0  31.905763   \n",
       "2 2015-01-30  阿坝州  34.0   19.0  30.0  7.0  13.0  0.6  48.0  31.905763   \n",
       "3 2015-01-29  阿坝州  31.0   18.0  31.0  7.0  15.0  0.5  32.0  31.905763   \n",
       "4 2015-01-28  阿坝州  29.0   18.0  29.0  7.0  14.0  0.6  27.0  31.905763   \n",
       "\n",
       "          lng  season quality  \n",
       "0  102.228565  Winter      良好  \n",
       "1  102.228565  Winter      优级  \n",
       "2  102.228565  Winter      优级  \n",
       "3  102.228565  Winter      优级  \n",
       "4  102.228565  Winter      优级  "
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bin_edges = [0, 50, 100, 150, 200, 300, 1210] # 根据AQI的划分等级设置标签\n",
    "bin_names = ['优级', '良好', '轻度污染', '中度污染', '重度污染', '重污染']\n",
    "# cut⽅法会根据bin_edges⾃动打上bin_names\n",
    "airCityDF['quality'] = pd.cut(airCityDF['aqi'], bin_edges,labels=bin_names)\n",
    "airCityDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "e622b2ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "city_province={'阿坝州': '四川省', '安康': '陕西省', '阿克苏地区': '新疆维吾尔自治区', '阿里地区': '西藏区', '阿拉善盟': '内蒙古自治区', '安庆': '安徽省', '安顺': '贵州省', '鞍山': '辽宁省', '克孜勒苏州': '新疆维吾尔自治区', '安阳': '河南省', '蚌埠': '安徽省', '白城': '吉林省', '北海': '广西壮族自治区', '宝鸡': '陕西省', '毕节': '贵州省', '白山': '吉林省', '百色': '广西壮族自治区', '保山': '云南省', '包头': '内蒙古自治区', '本溪': '辽宁省', '巴彦淖尔': '内蒙古自治区', '白银': '甘肃省', '巴中': '四川省', '滨州': '山东省', '亳州': '安徽省', '昌都': '西藏区', '常德': '湖南省', '赤峰': '内蒙古自治区', '昌吉州': '新疆维吾尔自治区', '五家渠': '新疆维吾尔自治区', '楚雄州': '云南省', '朝阳': '辽宁省', '长治': '山西省', '潮州': '广东省', '郴州': '湖南省', '池州': '安徽省', '崇左': '广西壮族自治区', '滁州': '安徽省', '丹东': '辽宁省', '德宏州': '云南省', '大理州': '云南省', '大庆': '黑龙江', '大同': '山西省', '定西': '甘肃省', '大兴安岭地区': '黑龙江', '德阳': '四川省', '东营': '山东省', '黔南州': '贵州省', '达州': '四川省', '德州': '山东省', '鄂尔多斯': '内蒙古自治区', '恩施州': '湖北省', '鄂州': '湖北省', '防城港': '广西壮族自治区', '抚顺': '辽宁省', '阜新': '辽宁省', '阜阳': '安徽省', '抚州': '江西省', '广安': '四川省', '贵港': '广西壮族自治区', '桂林': '广西壮族自治区', '果洛州': '青海省', '甘南州': '甘肃省', '广元': '四川省', '甘孜州': '四川省', '赣州': '江西省', '海北州': '青海省', '鹤壁': '河南省', '淮北': '安徽省', '河池': '广西壮族自治区', '海东地区': '青海省', '鹤岗': '黑龙江', '黄冈': '湖北省', '黑河': '黑龙江', '红河州': '云南省', '怀化': '湖南省', '呼伦贝尔': '内蒙古自治区', '葫芦岛': '辽宁省', '哈密地区': '新疆维吾尔自治区', '淮南': '安徽省', '黄山': '安徽省', '黄石': '湖北省', '和田地区': '新疆维吾尔自治区', '海西州': '青海省', '河源': '广东省', '衡阳': '湖南省', '汉中': '陕西省', '菏泽': '山东省', '贺州': '广西壮族自治区', '吉安': '江西省', '金昌': '甘肃省', '晋城': '山西省', '景德镇': '江西省', '西双版纳州': '云南省', '九江': '江西省', '吉林': '吉林省', '荆门': '湖北省', '佳木斯': '黑龙江', '济宁': '山东省', '酒泉': '甘肃省', '湘西州': '湖南省', '鸡西': '黑龙江', '揭阳': '广东省', '嘉峪关': '甘肃省', '焦作': '河南省', '锦州': '辽宁省', '晋中': '山西省', '荆州': '湖北省', '开封': '河南省', '黔东南州': '贵州省', '克拉玛依': '新疆维吾尔自治区', '喀什地区': '新疆维吾尔自治区', '六安': '安徽省', '来宾': '广西壮族自治区', '聊城': '山东省', '临沧': '云南省', '娄底': '湖南省', '临汾': '山西省', '漯河': '河南省', '丽江': '云南省', '吕梁': '山西省', '陇南': '甘肃省', '六盘水': '贵州省', '乐山': '四川省', '凉山州': '四川省', '莱芜': '山东省', '辽阳': '辽宁省', '辽源': '吉林省', '临沂': '山东省', '龙岩': '福建省', '洛阳': '河南省', '林芝': '西藏区', '柳州': '广西壮族自治区', '泸州': '四川省', '马鞍山': '安徽省', '牡丹江': '黑龙江', '茂名': '广东省', '眉山': '四川省', '绵阳': '四川省', '梅州': '广东省', '南充': '四川省', '宁德': '福建省', '内江': '四川省', '怒江州': '云南省', '南平': '福建省', '那曲地区': '西藏区', '南阳': '河南省', '平顶山': '河南省', '盘锦': '辽宁省', '平凉': '甘肃省', '莆田': '福建省', '萍乡': '江西省', '濮阳': '河南省', '攀枝花': '四川省', '曲靖': '云南省', '齐齐哈尔': '黑龙江', '七台河': '黑龙江', '黔西南州': '贵州省', '清远': '广东省', '庆阳': '甘肃省', '钦州': '广西壮族自治区', '泉州': '福建省', '日喀则': '西藏区', '日照': '山东省', '韶关': '广东省', '绥化': '黑龙江', '石河子': '新疆维吾尔自治区', '商洛': '陕西省', '三明': '福建省', '三门峡': '河南省', '山南': '西藏区', '遂宁': '四川省', '四平': '吉林省', '商丘': '河南省', '上饶': '江西省', '汕头': '广东省', '汕尾': '广东省', '三亚': '海南省', '邵阳': '湖南省', '十堰': '湖北省', '松原': '吉林省', '双鸭山': '黑龙江', '朔州': '山西省', '宿州': '安徽省', '随州': '湖北省', '泰安': '山东省', '塔城地区': '新疆维吾尔自治区', '铜川': '陕西省', '通化': '吉林省', '铁岭': '辽宁省', '通辽': '内蒙古自治区', '铜陵': '安徽省', '吐鲁番地区': '新疆维吾尔自治区', '铜仁地区': '贵州省', '天水': '甘肃省', '潍坊': '山东省', '威海': '山东省', '乌海': '内蒙古自治区', '芜湖': '安徽省', '乌兰察布': '内蒙古自治区', '渭南': '陕西省', '文山州': '云南省', '武威': '甘肃省', '梧州': '广西壮族自治区', '兴安盟': '内蒙古自治区', '许昌': '河南省', '宣城': '安徽省', '孝感': '湖北省', '迪庆州': '云南省', '锡林郭勒盟': '内蒙古自治区', '咸宁': '湖北省', '湘潭': '湖南省', '新乡': '河南省', '咸阳': '陕西省', '新余': '江西省', '信阳': '河南省', '忻州': '山西省', '雅安': '四川省', '延安': '陕西省', '延边州': '吉林省', '宜宾': '四川省', '宜昌': '湖北省', '宜春': '江西省', '运城': '山西省', '伊春': '黑龙江', '云浮': '广东省', '阳江': '广东省', '营口': '辽宁省', '榆林': '陕西省', '玉林': '广西壮族自治区', '阳泉': '山西省', '玉树州': '青海省', '烟台': '山东省', '鹰潭': '江西省', '玉溪': '云南省', '益阳': '湖南省', '岳阳': '湖南省', '永州': '湖南省', '淄博': '山东省', '自贡': '四川省', '湛江': '广东省', '张家界': '湖南省', '周口': '河南省', '驻马店': '河南省', '昭通': '云南省', '张掖': '甘肃省', '资阳': '四川省', '遵义': '贵州省', '枣庄': '山东省', '漳州': '福建省', '株洲': '湖南省', '深圳': '广东省', '福州': '福建省', '舟山': '浙江省', '青岛': '山东省', '无锡': '江苏省', '湖州': '浙江省', '成都': '四川省', '石家庄': '河北省', '苏州': '新疆维吾尔自治区', '连云港': '江苏省', '徐州': '江苏省', '廊坊': '河北省', '常州': '江苏省', '宿迁': '江苏省', '衡水': '河北省', '兰州': '甘肃省', '邢台': '河北省', '沧州': '河北省', '哈尔滨': '黑龙江', '济南': '山东省', '昆明': '云南省', '扬州': '江苏省', '杭州': '浙江省', '海口': '海南省', '南京': '江苏省', '广州': '广东省', '长沙': '湖南省', '厦门': '福建省', '秦皇岛': '河北省', '张家口': '河北省', '宁波': '浙江省', '南宁': '广西壮族自治区', '盐城': '江苏省', '邯郸': '河北省', '贵阳': '贵州省', '衢州': '浙江省', '承德': '河北省', '南通': '江苏省', '沈阳': '辽宁省', '呼和浩特': '内蒙古自治区', '中山': '广东省', '武汉': '湖北省', '合肥': '安徽省', '长春': '吉林省', '嘉兴': '浙江省', '大连': '辽宁省', '台州': '浙江省', '拉萨': '西藏区', '肇庆': '广东省', '西安': '陕西省', '保定': '河北省', '江门': '广东省', '西宁': '青海省', '乌鲁木齐': '新疆维吾尔自治区', '绍兴': '浙江省', '淮安': '江苏省', '温州': '浙江省', '郑州': '河南省', '惠州': '广东省', '泰州': '新疆维吾尔自治区', '珠海': '广东省', '南昌': '江西省', '唐山': '河北省', '金华': '浙江省', '佛山': '广东省', '东莞': '广东省', '丽水': '浙江省', '太原': '山西省', '镇江': '江苏省', '阿勒泰地区': '新疆维吾尔自治区', '北京': '北京', '博州': '新疆维吾尔自治区', '常熟': '江苏省', '富阳': '浙江省', '固原': '宁夏回族自治区', '海门': '江苏省', '海南州': '青海省', '黄南州': '青海省', ' 即墨': '山东省', '胶南': '山东省', '句容': '江苏省', '金坛': '江苏省', '江阴': '江苏省', '胶州': '山东省', '库尔勒': '新疆维吾尔自治区', '昆山': '江苏省', '临安': '浙江省', '莱西': '山东省', '临夏州': '甘肃省', '溧阳': '江苏省', '莱州': '山东省', '平度': '山东省', '普洱': '云南省', '蓬莱': '山东省', '荣成': '山东省', '乳山': '山东省', '寿光': '山东省', '石嘴山': '宁夏回族自治区', '太仓': '江苏省', '文登': '山东省', '瓦房店': '辽宁省', '吴江': '江苏省', '吴忠': '宁夏回族自治区', '襄阳': '湖北省', '伊犁哈萨克州': '新疆维吾尔自治区', '义乌': '浙江省', '宜兴': '江苏省', '诸暨': '浙江省', '张家港': '江苏省', '章丘': '山东省', '中卫': '宁夏回族自治区', '招远': '山东省', '天津': '天津市', '重庆': '重庆市', '银川': '甘肃省', '上海': '上海市'}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "c76204b4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>city</th>\n",
       "      <th>aqi</th>\n",
       "      <th>pm2_5</th>\n",
       "      <th>pm10</th>\n",
       "      <th>so2</th>\n",
       "      <th>no2</th>\n",
       "      <th>co</th>\n",
       "      <th>o3</th>\n",
       "      <th>lat</th>\n",
       "      <th>lng</th>\n",
       "      <th>season</th>\n",
       "      <th>quality</th>\n",
       "      <th>province</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2014-12-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>53.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>55.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>良好</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2015-01-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>45.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2015-01-30</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>34.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>48.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2015-01-29</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2015-01-28</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>29.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>27.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        time city   aqi  pm2_5  pm10  so2   no2   co    o3        lat  \\\n",
       "0 2014-12-31  阿坝州  53.0   33.0  55.0  3.0  23.0  1.0  35.0  31.905763   \n",
       "1 2015-01-31  阿坝州  31.0   18.0  29.0  7.0  10.0  0.5  45.0  31.905763   \n",
       "2 2015-01-30  阿坝州  34.0   19.0  30.0  7.0  13.0  0.6  48.0  31.905763   \n",
       "3 2015-01-29  阿坝州  31.0   18.0  31.0  7.0  15.0  0.5  32.0  31.905763   \n",
       "4 2015-01-28  阿坝州  29.0   18.0  29.0  7.0  14.0  0.6  27.0  31.905763   \n",
       "\n",
       "          lng  season quality province  \n",
       "0  102.228565  Winter      良好      四川省  \n",
       "1  102.228565  Winter      优级      四川省  \n",
       "2  102.228565  Winter      优级      四川省  \n",
       "3  102.228565  Winter      优级      四川省  \n",
       "4  102.228565  Winter      优级      四川省  "
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# map函数可以根据city的值 去dict中取出对应的values\n",
    "airCityDF['province'] = airCityDF['city'].map(city_province)\n",
    "airCityDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "b4d33242",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['海南省', '云南省', '福建省', '贵州省', '西藏区', '广东省', '广西壮族自治区', '黑龙江', '江西省',\n",
       "       '青海省', '内蒙古自治区', '四川省', '湖南省', '浙江省', '吉林省', '甘肃省', '重庆市', '上海市', '辽宁省',\n",
       "       '安徽省', '宁夏回族自治区', '湖北省', '江苏省', '陕西省', '山西省', '山东省', '新疆维吾尔自治区', '天津市',\n",
       "       '河南省', '北京', '河北省'],\n",
       "      dtype='object', name='province')"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airCityDF.groupby('province').mean().aqi.sort_values().index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "9ae79900",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 海南省\n",
      "2 云南省\n",
      "3 福建省\n",
      "4 贵州省\n",
      "5 西藏区\n",
      "6 广东省\n",
      "7 广西壮族自治区\n",
      "8 黑龙江\n",
      "9 江西省\n",
      "10 青海省\n",
      "11 内蒙古自治区\n",
      "12 四川省\n",
      "13 湖南省\n",
      "14 浙江省\n",
      "15 吉林省\n",
      "16 甘肃省\n",
      "17 重庆市\n",
      "18 上海市\n",
      "19 辽宁省\n",
      "20 安徽省\n",
      "21 宁夏回族自治区\n",
      "22 湖北省\n",
      "23 江苏省\n",
      "24 陕西省\n",
      "25 山西省\n",
      "26 山东省\n",
      "27 新疆维吾尔自治区\n",
      "28 天津市\n",
      "29 河南省\n",
      "30 北京\n",
      "31 河北省\n"
     ]
    }
   ],
   "source": [
    "for index,v in enumerate(airCityDF.groupby('province').mean().aqi.sort_values().index):\n",
    "    print(index+1,v)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "064c234c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'海南省': 1, '云南省': 2, '福建省': 3, '贵州省': 4, '西藏区': 5, '广东省': 6, '广西壮族自治区': 7, '黑龙江': 8, '江西省': 9, '青海省': 10, '内蒙古自治区': 11, '四川省': 12, '湖南省': 13, '浙江省': 14, '吉林省': 15, '甘肃省': 16, '重庆市': 17, '上海市': 18, '辽宁省': 19, '安徽省': 20, '宁夏回族自治区': 21, '湖北省': 22, '江苏省': 23, '陕西省': 24, '山西省': 25, '山东省': 26, '新疆维吾尔自治区': 27, '天津市': 28, '河南省': 29, '北京': 30, '河北省': 31}\n"
     ]
    }
   ],
   "source": [
    "provinceRank = airCityDF.groupby('province').mean().aqi.sort_values().index\n",
    "pro_rank_dict = {}\n",
    "for num,province in enumerate(provinceRank):\n",
    "    pro_rank_dict[province] = num + 1\n",
    "print(pro_rank_dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "05ebfe65",
   "metadata": {},
   "outputs": [],
   "source": [
    "airCityDF['provinceRank'] = airCityDF.province.map(pro_rank_dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "7fd445d3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>city</th>\n",
       "      <th>aqi</th>\n",
       "      <th>pm2_5</th>\n",
       "      <th>pm10</th>\n",
       "      <th>so2</th>\n",
       "      <th>no2</th>\n",
       "      <th>co</th>\n",
       "      <th>o3</th>\n",
       "      <th>lat</th>\n",
       "      <th>lng</th>\n",
       "      <th>season</th>\n",
       "      <th>quality</th>\n",
       "      <th>province</th>\n",
       "      <th>provinceRank</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2014-12-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>53.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>55.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>良好</td>\n",
       "      <td>四川省</td>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2015-01-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>45.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2015-01-30</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>34.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>48.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2015-01-29</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2015-01-28</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>29.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>27.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "      <td>12.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        time city   aqi  pm2_5  pm10  so2   no2   co    o3        lat  \\\n",
       "0 2014-12-31  阿坝州  53.0   33.0  55.0  3.0  23.0  1.0  35.0  31.905763   \n",
       "1 2015-01-31  阿坝州  31.0   18.0  29.0  7.0  10.0  0.5  45.0  31.905763   \n",
       "2 2015-01-30  阿坝州  34.0   19.0  30.0  7.0  13.0  0.6  48.0  31.905763   \n",
       "3 2015-01-29  阿坝州  31.0   18.0  31.0  7.0  15.0  0.5  32.0  31.905763   \n",
       "4 2015-01-28  阿坝州  29.0   18.0  29.0  7.0  14.0  0.6  27.0  31.905763   \n",
       "\n",
       "          lng  season quality province  provinceRank  \n",
       "0  102.228565  Winter      良好      四川省          12.0  \n",
       "1  102.228565  Winter      优级      四川省          12.0  \n",
       "2  102.228565  Winter      优级      四川省          12.0  \n",
       "3  102.228565  Winter      优级      四川省          12.0  \n",
       "4  102.228565  Winter      优级      四川省          12.0  "
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "airCityDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "f30040cf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'三亚': 1, '迪庆州': 2, '海口': 3, '丽江': 4, '黔西南州': 5, '怒江州': 6, '阿坝州': 7, '楚雄州': 8, '大理州': 9, '普洱': 10, '大兴安岭地区': 11, '伊春': 12, '甘孜州': 13, '黑河': 14, '林芝': 15, '临沧': 16, '南平': 17, '阿里地区': 18, '阿勒泰地区': 19, '龙岩': 20, '黄山': 21, '西双版纳州': 22, '黔南州': 23, '防城港': 24, '玉溪': 25, '三明': 26, '文山州': 27, '黔东南州': 28, '湛江': 29, '厦门': 30, '塔城地区': 31, '茂名': 32, '锡林郭勒盟': 33, '安顺': 34, '玉树州': 35, '梅州': 36, '汕尾': 37, '深圳': 38, '呼伦贝尔': 39, '保山': 40, '毕节': 41, '日喀则': 42, '昆明': 43, '兴安盟': 44, '宁德': 45, '德宏州': 46, '泉州': 47, '阳江': 48, '凉山州': 49, '曲靖': 50, '铜仁地区': 51, '云浮': 52, '惠州': 53, '钦州': 54, '北海': 55, '河源': 56, '昌都': 57, '鸡西': 58, '莆田': 59, '红河州': 60, '珠海': 61, '梧州': 62, '福州': 63, '汕头': 64, '山南': 65, '贺州': 66, '河池': 67, '佳木斯': 68, '崇左': 69, '双鸭山': 70, '玉林': 71, '贵阳': 72, '巴中': 73, '延边州': 74, '昭通': 75, '漳州': 76, '舟山': 77, '攀枝花': 78, '鹤岗': 79, '六盘水': 80, '百色': 81, '绥化': 82, '景德镇': 83, '陇南': 84, '中山': 85, '齐齐哈尔': 86, '南宁': 87, '贵港': 88, '丽水': 89, '拉萨': 90, '抚州': 91, '遵义': 92, '韶关': 93, '广元': 94, '湘西州': 95, '大庆': 96, '赣州': 97, '揭阳': 98, '来宾': 99, '博州': 100, '潮州': 101, '清远': 102, '新余': 103, '上饶': 104, '克拉玛依': 105, '江门': 106, '鹰潭': 107, '海西州': 108, '郴州': 109, '吉安': 110, '台州': 111, '雅安': 112, '永州': 113, '宜春': 114, '丹东': 115, '恩施州': 116, '海南州': 117, '牡丹江': 118, '温州': 119, '荣成': 120, '怀化': 121, '威海': 122, '白城': 123, '娄底': 124, '肇庆': 125, '通化': 126, '文登': 127, '佛山': 128, '桂林': 129, '商洛': 130, '果洛州': 131, '衢州': 132, '甘南州': 133, '东莞': 134, '赤峰': 135, '南昌': 136, '黄南州': 137, '乳山': 138, '富阳': 139, '广州': 140, '池州': 141, '鄂尔多斯': 142, '遂宁': 143, '乌兰察布': 144, '柳州': 145, '张家界': 146, '通辽': 147, '宁波': 148, '庆阳': 149, '九江': 150, '安康': 151, '宣城': 152, '朝阳': 153, '白山': 154, '益阳': 155, '海北州': 156, '七台河': 157, '衡阳': 158, '张家口': 159, '十堰': 160, '本溪': 161, '广安': 162, '烟台': 163, '固原': 164, '定西': 165, '哈密地区': 166, '大同': 167, '松原': 168, '天水': 169, '大连': 170, '绵阳': 171, '阿拉善盟': 172, '蓬莱': 173, '萍乡': 174, '义乌': 175, '平凉': 176, '邵阳': 177, '临安': 178, '阜新': 179, '资阳': 180, '伊犁哈萨克州': 181, '六安': 182, '咸宁': 183, '巴彦淖尔': 184, '安庆': 185, '辽源': 186, '海门': 187, '岳阳': 188, '常熟': 189, '临夏州': 190, '达州': 191, '张掖': 192, '瓦房店': 193, '榆林': 194, '常德': 195, '铜陵': 196, '南充': 197, '白银': 198, '重庆': 199, '那曲地区': 200, '金华': 201, '昆山': 202, '乐山': 203, '上海': 204, '延安': 205, '内江': 206, '青岛': 207, '太仓': 208, '武威': 209, '金坛': 210, '株洲': 211, '金昌': 212, '承德': 213, '四平': 214, '吴江': 215, '秦皇岛': 216, '黄石': 217, '黄冈': 218, '绍兴': 219, '湘潭': 220, '汉中': 221, '西宁': 222, '溧阳': 223, '盐城': 224, '招远': 225, '嘉峪关': 226, '盘锦': 227, '吕梁': 228, '呼和浩特': 229, '铁岭': 230, '辽阳': 231, '宜宾': 232, '莱州': 233, '随州': 234, '抚顺': 235, '吴忠': 236, '泸州': 237, '南通': 238, '芜湖': 239, '即墨': 240, '吉林': 241, '德阳': 242, '海东地区': 243, '孝感': 244, '句容': 245, '营口': 246, '杭州': 247, '连云港': 248, '嘉兴': 249, '胶州': 250, '淮南': 251, '长沙': 252, '马鞍山': 253, '长春': 254, '葫芦岛': 255, '阜阳': 256, '莱西': 257, '苏州': 258, '荆门': 259, '滁州': 260, '中卫': 261, '鄂州': 262, '眉山': 263, '乌海': 264, '银川': 265, '诸暨': 266, '鞍山': 267, '包头': 268, '蚌埠': 269, '湖州': 270, '酒泉': 271, '张家港': 272, '日照': 273, '平度': 274, '锦州': 275, '哈尔滨': 276, '泰州': 277, '胶南': 278, '扬州': 279, '无锡': 280, '常州': 281, '石嘴山': 282, '宜兴': 283, '镇江': 284, '昌吉州': 285, '信阳': 286, '兰州': 287, '朔州': 288, '南京': 289, '江阴': 290, '忻州': 291, '亳州': 292, '石河子': 293, '淮安': 294, '合肥': 295, '宿迁': 296, '沈阳': 297, '荆州': 298, '铜川': 299, '晋中': 300, '宜昌': 301, '宿州': 302, '自贡': 303, '淮北': 304, '宝鸡': 305, '武汉': 306, '成都': 307, '襄阳': 308, '长治': 309, '晋城': 310, '阳泉': 311, '太原': 312, '商丘': 313, '徐州': 314, '驻马店': 315, '临汾': 316, '运城': 317, '周口': 318, '南阳': 319, '五家渠': 320, '乌鲁木齐': 321, '天津': 322, '许昌': 323, '三门峡': 324, '泰安': 325, '鹤壁': 326, '章丘': 327, '滨州': 328, '漯河': 329, '潍坊': 330, '濮阳': 331, '西安': 332, '渭南': 333, '寿光': 334, '北京': 335, '东营': 336, '沧州': 337, '开封': 338, '济宁': 339, '吐鲁番地区': 340, '临沂': 341, '洛阳': 342, '咸阳': 343, '廊坊': 344, '新乡': 345, '莱芜': 346, '库尔勒': 347, '枣庄': 348, '淄博': 349, '唐山': 350, '济南': 351, '平顶山': 352, '焦作': 353, '郑州': 354, '菏泽': 355, '聊城': 356, '德州': 357, '安阳': 358, '邯郸': 359, '衡水': 360, '克孜勒苏州': 361, '石家庄': 362, '阿克苏地区': 363, '邢台': 364, '保定': 365, '喀什地区': 366, '和田地区': 367}\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>time</th>\n",
       "      <th>city</th>\n",
       "      <th>aqi</th>\n",
       "      <th>pm2_5</th>\n",
       "      <th>pm10</th>\n",
       "      <th>so2</th>\n",
       "      <th>no2</th>\n",
       "      <th>co</th>\n",
       "      <th>o3</th>\n",
       "      <th>lat</th>\n",
       "      <th>lng</th>\n",
       "      <th>season</th>\n",
       "      <th>quality</th>\n",
       "      <th>province</th>\n",
       "      <th>provinceRank</th>\n",
       "      <th>cityRank</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2014-12-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>53.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>55.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>良好</td>\n",
       "      <td>四川省</td>\n",
       "      <td>12.0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2015-01-31</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>45.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "      <td>12.0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2015-01-30</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>34.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>48.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "      <td>12.0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2015-01-29</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>31.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>0.5</td>\n",
       "      <td>32.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "      <td>12.0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2015-01-28</td>\n",
       "      <td>阿坝州</td>\n",
       "      <td>29.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>0.6</td>\n",
       "      <td>27.0</td>\n",
       "      <td>31.905763</td>\n",
       "      <td>102.228565</td>\n",
       "      <td>Winter</td>\n",
       "      <td>优级</td>\n",
       "      <td>四川省</td>\n",
       "      <td>12.0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        time city   aqi  pm2_5  pm10  so2   no2   co    o3        lat  \\\n",
       "0 2014-12-31  阿坝州  53.0   33.0  55.0  3.0  23.0  1.0  35.0  31.905763   \n",
       "1 2015-01-31  阿坝州  31.0   18.0  29.0  7.0  10.0  0.5  45.0  31.905763   \n",
       "2 2015-01-30  阿坝州  34.0   19.0  30.0  7.0  13.0  0.6  48.0  31.905763   \n",
       "3 2015-01-29  阿坝州  31.0   18.0  31.0  7.0  15.0  0.5  32.0  31.905763   \n",
       "4 2015-01-28  阿坝州  29.0   18.0  29.0  7.0  14.0  0.6  27.0  31.905763   \n",
       "\n",
       "          lng  season quality province  provinceRank  cityRank  \n",
       "0  102.228565  Winter      良好      四川省          12.0         7  \n",
       "1  102.228565  Winter      优级      四川省          12.0         7  \n",
       "2  102.228565  Winter      优级      四川省          12.0         7  \n",
       "3  102.228565  Winter      优级      四川省          12.0         7  \n",
       "4  102.228565  Winter      优级      四川省          12.0         7  "
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cityRank = airCityDF.groupby('city').mean().aqi.sort_values().index\n",
    "city_rank_dict = {}\n",
    "for num,city in enumerate(cityRank):\n",
    "    city_rank_dict[city] = num + 1\n",
    "print(city_rank_dict)\n",
    "# 匹配省名，增加排名列\n",
    "airCityDF['cityRank'] = airCityDF['city'].map(city_rank_dict)\n",
    "airCityDF.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "bd7a8331",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'C:\\\\Users\\\\zzk10\\\\PycharmProjects\\\\python-demo1\\\\notebook\\\\全国主要城市空⽓质量图.html'"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Geo\n",
    "from pyecharts.globals import GeoType\n",
    "import pyecharts.options as opts\n",
    "\n",
    "keys = airCityDF.groupby('city').aqi.mean().index\n",
    "values = airCityDF.groupby('city').aqi.mean().values\n",
    "\n",
    "# geo = Geo(\"全国主要城市空⽓质量图\", \"data from AQI\")\n",
    "# 创建地图对象，配置长度宽度背景颜色\n",
    "geo = Geo(is_ignore_nonexistent_coord=True,init_opts=opts.InitOpts(bg_color=\"#404a59\", width='800px', height='600px'))\n",
    "# 设置需要绘制的地图\n",
    "geo.add_schema(maptype=\"china\", is_roam=True)\n",
    "\n",
    "# 添加数据\n",
    "geo.add(\"全国主要城市空⽓质量图\",\n",
    "        [list(z) for z in zip(keys, values)],\n",
    "        symbol_size=10,\n",
    "        type_=GeoType.EFFECT_SCATTER\n",
    ")\n",
    "\n",
    "# 对地图进行配置\n",
    "geo.set_global_opts(\n",
    " visualmap_opts=opts.VisualMapOpts(min_=38, max_=194),\n",
    " title_opts=opts.TitleOpts(title=\"全国主要城市空⽓质量图\")\n",
    ")\n",
    "\n",
    "# 设置是否显示图例\n",
    "geo.set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "# 渲染地图，生成html文件\n",
    "geo.render(\"./全国主要城市空⽓质量图.html\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "id": "12cb9347",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "c6a6fbfd",
   "metadata": {},
   "outputs": [],
   "source": [
    "s1 = airCityDF.groupby('city').aqi.mean().sort_values().tail(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "ecd05ffa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(s1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "1012bacb",
   "metadata": {},
   "outputs": [],
   "source": [
    "df1 = pd.DataFrame(s1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "f13d0b8d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.frame.DataFrame"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(df1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "cb55312b",
   "metadata": {},
   "outputs": [],
   "source": [
    "df1 = df1.reset_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "id": "a001577e",
   "metadata": {},
   "outputs": [],
   "source": [
    "from matplotlib.font_manager import FontProperties\n",
    "myfont=FontProperties(fname=r'C:\\Windows\\Fonts\\simhei.ttf',size=14)\n",
    "sns.set(font=myfont.get_name())\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "59e9bc64",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:xlabel='aqi', ylabel='city'>"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAa8AAAEICAYAAADocntXAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAA080lEQVR4nO3deXxM9/7H8ddMFoTQqiXW21yllgqutXYNrV0ahBS1hKtVpcRya0vVdqvEUnqV4tpK6a2rrehVRVGaItzeW/tWa4WILYnMTOb8/sgvc4Ug2iQzk7yfj0cfzZw558znHJO853zPd75fk2EYBiIiIm7E7OwCREREHpfCS0RE3I7CS0RE3I7CS0RE3I7CS0RE3I7CS0RE3I7CS0RE3I6nswvI7eLjE7DbXferdE89VYi4uNvOLuOhVGPWUI1Zxx3qdNcazWYTTz5Z8JHbKryyWWb+EZztqacKObuER1KNWSO31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jIyEiCgoJISkpKt83MmTMZM2YMc+bMISAggPnz5wNkSdd9ERH5/Vym2bBEiRK89957FC5cmLThFvPly4fNZmPatGlUqVKFXr16YbPZsNlsD73n9Yc//AGAzZs3s2bNGiIiIggMDOTAgQNER0cTEBBAQEAAAGPHjqVq1ar06NEDAC8vLxo0aMAbb7xB/vz5gdQZlGfMmKGmQxERF+Ey4fXkk0/y5JNPAqld2tMMGzaMggULArBo0SJHoN19z+tu165dc1y9tWvXjnbt2jmeq1atGosXLyYkJMSxrESJEumCLzQ09IE1GobBwIEDadGixe84UhER+b00qvxjsNvtGIbxWL0ONTCviOQ1kS83y9QszhpVPoc86vtlIiKSM/TXWERE3I6aDUVEJEtpMspcID4+AbvddT8fPPVUIeLibju7jIdSjVlDNWYdd6jT2TWazaZHr5TBepndTldeIiLidnTPS0RE3I7CS0RE3I7CS0RE3I7CS0RE3I7CS0RE3I7CS0RE3I7CS0RE3I7CS0RE3I7CS0RE3I6Gh8pDbt++zYgRI7BarVy/fp0JEyZw6tQpFi5cSLFixQCYOnUq5cqVc3Klru3LL79k7dq1jsc//fQT77zzjs7jY7BarbzxxhuEhYVRv359oqKiWLp0KV5eXjzzzDNMnDgRk8lE27ZteeqppwCoW7cuQ4YMcXLlruXe89ivXz+sVisAcXFx1KlTh3fffTd3nkdDstxHH31kBAUFGf369TOuXLni7HIcVq5caWzcuNEwDMP49ttvjddff90YM2aM8d///tfJlaXXpk0bo2fPnkbPnj2NOXPmGLdu3TJ69+5tdOvWzYiMjHR2eekcPHjQGD58uEudR4vFYgwYMMD44YcfDMMwjIsXLxohISFGSEiIsXLlSsd669evNzp16mT07NnTOHnyZI7VZ7Vajf79+xvt2rUzfvjhB+POnTvG66+/bty5c8cwDMN4+eWXjUOHDhmXLl0yBg4cmGN13eve8/j5558brVu3drw3z549axiG65zHe7322mvG0aNHnXoeb926ZQwcONDo16+fERwcbBw8eDDL3o8Kryy2f/9+o1u3bobNZjN2795tjBs3ztklZWjt2rVGRESE8eKLL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5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.barplot(x=\"aqi\", y=\"city\", data=df1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6b41f9a3",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
